package com.fm.openinstall.c;

import org.json.*;

public class b
{
    private c a;
    private int b;
    private String c;
    private String d;
    private String e;

    public b() {
    }

    public b(final c a, final int b) {
        this.a = a;
        this.b = b;
    }

    public static b a(String s) {
        final b b = new b();
        final JSONObject jsonObject = new JSONObject(s);
        if (jsonObject.has("config") && !jsonObject.isNull("config")) {
            b.d(jsonObject.optString("config"));
        }
        final int optInt = jsonObject.optInt("code", -2);
        if (optInt == 0) {
            b.a(c.a);
            b.a(0);
            if (jsonObject.has("body") && !jsonObject.isNull("body")) {
                b.c(jsonObject.optString("body"));
            }
            if (!jsonObject.has("msg") || jsonObject.isNull("msg")) {
                return b;
            }
            s = jsonObject.optString("msg");
        }
        else {
            b.a(c.c);
            b.a(-2);
            final StringBuilder sb = new StringBuilder();
            sb.append(optInt);
            sb.append(" : ");
            sb.append(jsonObject.optString("msg"));
            s = sb.toString();
        }
        b.b(s);
        return b;
    }

    public c a() {
        return this.a;
    }

    public void a(final int b) {
        this.b = b;
    }

    public void a(final c a) {
        this.a = a;
    }

    public int b() {
        return this.b;
    }

    public void b(final String d) {
        this.d = d;
    }

    public String c() {
        return this.d;
    }

    public void c(final String c) {
        this.c = c;
    }

    public String d() {
        return this.c;
    }

    public void d(final String e) {
        this.e = e;
    }

    public String e() {
        return this.e;
    }
}
